/*
package com.bing.bingPro.controller.protest;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.TypeReference;
import com.bing.bingPro.common.BaseResult;
import com.bing.bingPro.entity.TestStatusEntity;
import com.bing.bingPro.mapper.TestDetailsMapper;
import com.bing.bingPro.service.ProTerminalTestExportService;
import com.bing.bingPro.service.TestDetailsConfigService;
import com.bing.bingPro.service.TestDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/v4/testDetail")
public class TestDetailsController {

    private static final String SYSERR = "system error !";
    private static final String DATALIST = "datalist";


    @Autowired
    private TestDetailsService testDetailsService;

    @Autowired
    private TestDetailsConfigService testDetailsConfigService;

    @Autowired
    private ProTerminalTestExportService proTerminalTestExportService;

    private final TestDetailsMapper testDetailsMapper;

    public TestDetailsController(TestDetailsMapper testDetailsMapper) {
        this.testDetailsMapper = testDetailsMapper;
    }

    */
/**
     * 查询省级终端版本提测数据
     *//*

    @PostMapping("/lineinfoData")
    public BaseResult<Object> lineInfoApi(@RequestParam(defaultValue = "") String province,
                                          @RequestParam() List<String> vendor,
                                          @RequestParam(defaultValue = "") String status,
                                          @RequestParam(defaultValue = "") String version,
                                          @RequestParam(defaultValue = "") String gatewayModel,
                                          @RequestParam(defaultValue = "10") Integer size,
                                          @RequestParam(defaultValue = "") String year,
                                          @RequestParam(defaultValue = "1") Integer current) throws ParseException {
        BaseResult<Object> bro = new BaseResult<>();
        Map<String, Object> stringObjectMap = testDetailsService.lineInfo(province, vendor, status, version, gatewayModel, year, current, size, null);
        bro.setData(stringObjectMap);
        return bro;
    }


    */
/**
     * 导出省级终端版本提测数据
     *//*

    @GetMapping("/lineinfoExport")
    public void lineInfoExportApi(HttpServletResponse response,
                                  @RequestParam(defaultValue = "") String province,
                                  @RequestParam(defaultValue = "") List<String> vendor,
                                  @RequestParam(defaultValue = "") String status,
                                  @RequestParam(defaultValue = "") String version,
                                  @RequestParam(defaultValue = "") String gatewayModel,
                                  @RequestParam(defaultValue = "") String year,
                                  @RequestParam(defaultValue = "1") Integer current,
                                  Long[] ids) {
        try {
            Map<String, Object> stringObjectMap = testDetailsService.lineInfo(province, vendor, status, version, gatewayModel, year, current, -1, ids);
            List<Map<String, Object>> datalist = Convert.convert(new TypeReference<List<Map<String, Object>>>() {
            }, stringObjectMap.get(DATALIST)); //将Object转换List<Map<String, Object>>类型
            proTerminalTestExportService.submitTestExport(response, datalist, year);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    */
/**
     * 省级终端版本提测表导出-全量
     *
     * @return xls文件
     *//*

    @GetMapping("/lineinfoAllExport")
    public void lineInfoAllExportApi(HttpServletResponse response) {
        try {
            List<Map<String, Object>> vstringObjectMap = testDetailsService.lineAllInfo();
            proTerminalTestExportService.submitTestAllExport(response, vstringObjectMap);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    */
/**
     * 待省端开始测试
     *
     * @return 更新后的提测数据
     *//*

    @PostMapping("/provinceStartTest")
    public BaseResult<Object> provinceStartTestApi(String year) {
        BaseResult<Object> bro = new BaseResult<>();
        try {
            Map<String, Object> map = testDetailsService.provinceStartTestFunc(year);
            bro.setData(map);
            return bro;
        } catch (Exception e) {
            e.printStackTrace();
            bro.setData(SYSERR);
            return bro;
        }
    }


    */
/**
     * 厂家添加测试版本
     *
     * @return 更新后的提测数据
     *//*

    @PostMapping("/addTestVersion")
    public BaseResult<Object> addTestVersionApi(Long ids,
                                                String vendor,
                                                String province,
                                                String gateway_model,
                                                String tversion,
                                                String year) {
        BaseResult<Object> bro = new BaseResult<>();
        try {
            Map<String, Object> map = testDetailsService.addTestVersionFunc(ids, vendor, province, gateway_model, tversion, year);
            bro.setData(map);
            return bro;
        } catch (Exception e) {
            e.printStackTrace();
            bro.setData(SYSERR);
            return bro;
        }
    }

    */
/**
     * 提测状态查询
     *
     * @param ids
     * @param year
     * @return 提测状态数据
     *//*

    @PostMapping("/testStatusQuery")
    public BaseResult<Object> testStatusQueryApi(Long ids, String year) {
        BaseResult<Object> bro = new BaseResult<>();
        try {
            List<TestStatusEntity> testStatusEntities = testDetailsService.testStatusQueryFunc(ids, year);
            bro.setData(testStatusEntities);
            return bro;
        } catch (Exception e) {
            e.printStackTrace();
            bro.setData(SYSERR);
            return bro;
        }
    }

    */
/**
     * 省端测试结果提交
     *
     * @return 更新后的提测数据
     *//*

    @PostMapping("/testResultSubmit")
    public BaseResult<Object> testResultSubmitApi(Long ids,
                                                  String testresult,
                                                  MultipartFile detailfile,
                                                  String testopinion,
                                                  @RequestParam(defaultValue = "") String province,
                                                  String cm_contact,
                                                  String cm_contact_mailbox,
                                                  String cm_contact_phone,
                                                  String year) {
        BaseResult<Object> bro = new BaseResult<>();
        try {
            Map<String, Object> map = testDetailsService.testResultSubmitFunc(ids, testresult, detailfile, testopinion, cm_contact,
                    cm_contact_mailbox, cm_contact_phone, province, year);

            bro.setData(map);
            return bro;
        } catch (Exception e) {
            e.printStackTrace();
            bro.setData(SYSERR);
            return bro;
        }
    }

    */
/**
     * 下载提测明细表
     *
     * @param ids
     * @param year
     * @return xls文件
     *//*

    @GetMapping("/downloadDetailTable")
    @ResponseBody
    public BaseResult<Object> downloadDetailTableApi(HttpServletResponse response,
                                                     Long[] ids,
                                                     String year) {
        BaseResult<Object> bro = new BaseResult<>();
        try {
            Map<String, Object> map = proTerminalTestExportService.downloadDetailTableFunc(response, ids, year);
            bro.setData(map);
            return bro;
        } catch (Exception e) {
            e.printStackTrace();
            bro.setData(SYSERR);
            return bro;
        }
    }

    */
/**
     * 下载提测条目测试模版
     *
     * @return xls文件
     *//*

    @GetMapping("/downloadDetailStencil")
    public void downloadDetailStencilApi(HttpServletResponse response) {
        proTerminalTestExportService.downloadDetailStencilFunc(response);
    }


    @PostMapping("/NewImport")
    public BaseResult<Object> newSetTableDataApi(MultipartFile fileData) throws IOException, ParseException {
        BaseResult<Object> bro = new BaseResult<>();
        String stringObjectMap = testDetailsConfigService.newSetDataTableFunc(fileData);
        bro.setData(stringObjectMap);
        return bro;
    }

    @PostMapping("sendEmailFirst")
    //@Scheduled(cron = "0 46 12 * * FRI")
    public BaseResult sendEmailFirst() {
        testDetailsConfigService.testSendEmailJob();
        return new BaseResult<>();
    }

}
*/
